//
//  EventSettingItem.m
//  01-Event
//
//  Created by apple on 13-12-23.
//  Copyright (c) 2013年 Event. All rights reserved.
//

#define FONT(font)  [UIFont systemFontOfSize:font]

#import "EventSettingItem.h"

@implementation EventSettingItem

/**
 *  初始化Cell
 *
 *  @param icon  图片
 *  @param title 标题
 *  @param type  描述文字
 *  @param desc  描述文字颜色
 *
 *  @return 对应Cell模型
 */
+ (id)itemWithImage:(UIImage *)icon title:(NSString *)title type:(EventSettingItemType)type desc:(NSString *)desc  descColor:(UIColor *)color viewTag:(BuildScheduleLabelType )viewTag
{
   
    EventSettingItem *item = [[self alloc] init];
    item.icon = icon;
    item.detailLabelColor = color;
    item.title = title;
    item.type = type;
    item.desc = desc;
    item.scheduleType = viewTag;

    return item;
}

/**
 *  初始化Cell
 *
 *  @param icon  图片
 *  @param title 标题
 *  @param type  描述文字
 *  @param desc  描述文字颜色
 *
 *  @return 对应Cell模型
 */
+ (id)itemWithImage:(UIImage *)icon title:(NSString *)title type:(EventSettingItemType)type image:(UIImage *)image  viewTag:(BuildScheduleLabelType )viewTag
{
    EventSettingItem *item = [[self alloc] init];
    item.icon = icon;
    item.title = title;
    item.type = type;
    item.scheduleType = viewTag;
    item.image = image;
    return item;
}

/**
 *  使用DetailLabelColor初始化Cell
 *
 *  @param icon             图片
 *  @param title            标题
 *  @param type             类型
 *  @param desc             描述
 *  @param detailLabelColor 描述文字颜色
 *
 *  @return 对应的Cell模型
 */
+ (id)itemWithImage:(UIImage *)icon title:(NSString *)title type:(EventSettingItemType)type desc:(NSString *)desc detailLabelColor:(UIColor *)detailLabelColor viewTag:(BuildScheduleLabelType )viewTag
{
    EventSettingItem *item = [[self alloc] init];
    item.icon = icon;
    item.title = title;
    item.type = type;
    item.desc = desc;
    item.detailLabelColor = detailLabelColor;
    item.scheduleType = viewTag;
    return item;
}


/**
 *  初始化Cell（设置描述文字颜色）
 */
+ (id)itemWithIcon:(NSString *)imageName Title:(NSString *)title type:(EventSettingItemType)type placeHolder:(NSString *)placeHolder textColor:(UIColor *)color text:(NSString *)text titleFont:(NSInteger)font viewTag:(BuildScheduleLabelType)viewTag
{
    EventSettingItem *item = [[self alloc] init];
    item.title = title;
    item.titleFont = font;
//    CGFloat KScreenWidth = [UIScreen mainScreen].bounds.size.width;
//    item.tableView_rowHieght = [title sizeWithFont:FONT(font) maxSize:CGSizeMake(KScreenWidth - 10, MAXFLOAT)].height;
    item.textColor = color;
    item.icon = [UIImage imageNamed:imageName];
    item.text = text;
    item.type = type;
    item.scheduleType = viewTag;
    item.placeHolder = placeHolder;
    return item;
}

//开关的状态
+ (id)itemWithImage:(UIImage *)icon title:(NSString *)title type:(EventSettingItemType)type swicthON:(NSString *)swicthOn viewTag:(BuildScheduleLabelType )viewTag{
    EventSettingItem *item = [[self alloc] init];
    item.icon = icon;
    item.title = title;
    item.isSwitchON = [swicthOn integerValue];
    item.type = type;
    item.scheduleType = viewTag;
    return item;
}


//textView的文字
+ (id)itemWithImage:(NSString *)icon text:(NSString *)text type:(EventSettingItemType)type viewTag:(BuildScheduleLabelType)viewTag placeHolder:(NSString *)placeHolder{
    EventSettingItem *item = [[self alloc] init];
    item.icon = [UIImage imageNamed:icon];
    item.text = text;
    item.type = type;
    item.scheduleType = viewTag;
    item.placeHolder = placeHolder;
    return item;
}


+ (id)itemWithText:(NSString *)text type:(EventSettingItemType)type viewTag:(BuildScheduleLabelType )viewTag placeHolder:(NSString *)placeHolder btnColer:(NSArray *)colorArr btnTitle:(NSArray *)titleArr{
    
    EventSettingItem *item = [[self alloc] init];
    item.text = text;
    item.type = type;
    item.scheduleType = viewTag;
    item.colorArr = colorArr;
    item.titleArr = titleArr;
    item.placeHolder = placeHolder;
    return item;
}


+ (id)itemWithText:(NSString *)text type:(EventSettingItemType)type viewTag:(BuildScheduleLabelType )viewTag placeHolder:(NSString *)placeHolder btnColer:(NSArray *)colorArr btnTitle:(NSArray *)titleArr btnSelectd:(NSInteger )slecetIndex{
    EventSettingItem *item = [[self alloc] init];
    item.text = text;
    item.selectedIndex = slecetIndex;
    item.type = type;
    item.scheduleType = viewTag;
    item.colorArr = colorArr;
    item.titleArr = titleArr;
    item.placeHolder = placeHolder;
    return item;
}


+ (id)itemWithStartTimeText:(NSString *)startTime endTimeText:(NSString *)endTime type:(EventSettingItemType)type viewTag:(BuildScheduleLabelType )viewTag{
    
    EventSettingItem *item = [[self alloc] init];
    
    item.startTime = startTime;
    item.endTime = endTime;
    item.type = type;
    item.scheduleType = viewTag;
    
    return item;
}

+ (id)itemWithText:(NSString *)startTime image:(UIImage *)icon type:(EventSettingItemType)type viewTag:(BuildScheduleLabelType )viewTag arrowImageName:(NSString *)arrowImageName{
    
    EventSettingItem *item = [[self alloc] init];
    item.title = startTime;
    item.arrowImageName = arrowImageName;
    item.image = icon;
    item.type = type;
    item.scheduleType = viewTag;
    return item;
}

+ (id)itemWithText:(NSString *)startTime image:(UIImage *)icon type:(EventSettingItemType)type viewTag:(BuildScheduleLabelType )viewTag arrowImageName:(NSString *)arrowImageName isArrowHidden:(BOOL)isArrowHidden{
    
    EventSettingItem *item = [[self alloc] init];
    item.title = startTime;
    item.arrowImageName = arrowImageName;
    item.image = icon;
    item.isArrowHidden = isArrowHidden;
    item.type = type;
    item.scheduleType = viewTag;
    return item;
}


@end
